/*
* @File Name main.cpp
* @File Path M:\MAS2\PRM_Robotic_Arm\PRMCcode\coding\task\main.cpp
* @Author: Ruige_Lee
* @Date:   2019-09-26 19:20:22
* @Last Modified by:   Ruige_Lee
* @Last Modified time: 2019-09-26 19:27:00
* @Email: 295054118@whut.edu.cn
* @page: https://whutddk.github.io/
*/
/*
* @File Name main.cpp
* @File Path M:\MAS2\PRM_Robotic_Arm\PRMCcode\coding\task\main.cpp
* @Author: Ruige_Lee
* @Date:   2019-04-17 16:44:41
* @Last Modified by:   Ruige_Lee
* @Last Modified time: 2019-04-17 16:54:09
* @Email: 295054118@whut.edu.cn"
*/




#include "task/include.h"


#include <stdint.h>


#include "xil_printf.h"


extern void task_collide();

extern uint8_t flag_500us;
extern uint8_t flag_10ms;
extern uint8_t flag_100ms;
extern uint8_t flag_500ms;
extern uint8_t flag_1s;
extern uint8_t flag_2s;

extern float prmBotPose[6];
extern uint8_t rePlaning;


uint8_t global_release = 0;
int main(int argc, char **argv)
{
 	uart_hw_setup();

	stepper_initialize();

	Xscu_timer_init();


	while(1)
	{
		task_rec();


		if ( global_release )
		{
			if ( flag_100ms )
			{
				RP_execute( &prmBotPose[0] );
				flag_100ms = 0;
			}

			if ( flag_2s )
			{
				task_collide();

				flag_2s = 0;
			}
		}

	}
	
	return 0;
}



